from django.shortcuts import render,HttpResponse
from .models import *
import markdown 
from django.utils.safestring import mark_safe
# Create your views here.
def show(request):
    ctx ={}
    g=interdetail.objects.get(id=1)
    g.decrible=markdown.markdown(g.decrible,extensions=['markdown.extensions.extra','markdown.extensions.toc'])
    ctx['goods']=g
    print(g.id,g.name,g.decrible)
    return render(request,"show.html",ctx)

def index(request):
    return HttpResponse( mark_safe('<a href="static/index.html">数据结构与算法</a>'))